﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>充值记录-微街秀管理后台</title>
    <link href="../../Client/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="../css/admin.css" rel="stylesheet" type="text/css" />
    <style>
        /*分页*/
        .pager_style{width: 100%;height: 30px;margin-top: 10px;text-align: left;color: #909090;}
        .pager_style li{font-size: 14px;}
        .pager_style .page_num{height: 100%;font-size: 0;display: inline-block;float: left;}
        .pager_style .page_num li{height: 100%;border: 1px solid #eeeeee;padding: 0 10px;margin-right: 5px;line-height: 30px;display: inline-block;cursor: pointer;float: left;}
        .pager_style .page_num li:hover{border: 1px solid #f37b0b;background-color: #f37b0b;color: White;}
        /*分页 选中当页样式*/
        .pager_style .page_num .active{border: 1px solid #f37b0b;background-color: #f37b0b;color: White;cursor: default;}
        /*分页 不可用样式*/
        .pager_style .page_num .disable{background-color: #f1f1f1;}
        .pager_style .page_num .disable:hover{border: 1px solid #eeeeee;background-color: #f1f1f1;color: #909090;}
        .pager_style .page_info{display: inline-block;float: left;}
        .pager_style .page_info li{display: inline-block;margin-left: 10px;float: left;line-height: 30px;}
        table{border-collapse: collapse;border: none;width: 980px;text-align: center;}
        td{border: solid #ccc 1px;color: Black;height: 26px;}
        td a{text-decoration: none;}
        .td1, .td2, .td3, .td6{width: 100px;font-weight: bold;text-align: center;}
        .td4, .td5{width: 250px;font-weight: bold;text-align: center;}
    </style>
    <script src="../js/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script src="../js/base.js" type="text/javascript"></script>
    <script src="../js/ajax-data.js" type="text/javascript"></script>
    <script src="../js/Pager.js" type="text/javascript"></script>
    <script src="../js/dialog.js" type="text/javascript"></script>
</head>
<body class="mainbody">
<div class="navigation"><a href="javascript:" class="back">后退</a>首页 &gt; 交易管理 &gt; <span class="headtitle">充值记录</span></div>
<hr style="margin-top:0px;" />
<div style="width:860px; margin-left:auto; margin-right:auto;">
<div>微街秀ID:<input type="text" id="userid" name="userid" style="width:80px;" />
     订单号:<input type="text" id="orderid" name="orderid" style="width:120px;"/>
     平台:<select id="platform">
                <option value="-1">不限</option>
                <option value="1">微信</option>
                <option value="2">支付宝</option>
            </select>
     状态:<select id="state">
                <option value="-1">不限</option>
                <option value="0">失败</option>
                <option value="1">成功</option>
            </select>
    <input type="button" id="btn" value="搜 索" onclick="submits()" /></div>
    <br />
  <table id="list">
    </table>
 <div class="pager_style">
    <ul class="page_num"></ul>
    <ul class="page_info">
        <li>总数:<span id="count">0</span></li>
        <li>每页:<span id="pageSize">0</span></li>
        <li>页数:<span id="pageToal">0</span></li>
    </ul>
     <div style="clear:both">
 注意:<br/>
 1、状态:分为 成功、失败、取消等3种，含义分别为：<br/>
   <div style="padding-left:23px;">
   成功：付款成功<br/>
   失败：充值失败<br/>
   取消：用户取消了充值
   </div>
   </div>
</div>
<input type="hidden" id="pagecount" value="0" />
</div>
 <script>
     $(function () {       
         GetList(1);
     })

     function GetList(page) {
         var param = "page_index=" + page;
         param += "&userid=" + $("#userid").val();
         param += "&state=" + $("#state").val();
         param += "&platform=" + $("#platform").val();
         param += "&orderid=" + $("#orderid").val();
         $("#list").html("");
         var html = "<tr><td class='td1'>微街秀ID</td><td class='td3'>订单号</td><td class='td2'>订单总额</td><td class='td2'>支付金额</td><td class='td4'>平台</td><td class='td4'>交易状态</td><td class='td5'>交易时间</td><td class='td3'>详情</td>";
         html += "</tr>";

         AjaxStart("../ajax/fc_order.ashx?getlist", param, function (data) {
             if (data.code != 0) {
                 $("#list").html(html + "<tr><td colspan='8'>" + data.msg + "</td></tr>");
             }
             else {
                 $("#list").html("");
                 var list = data.item.table;
                 for (var i = 0; i < list.length; i++) {
                     var platform = "";
                     if (list[i].platform == 1)
                         platform = "微信";
                     else if (list[i].platform == 2)
                         platform = "支付宝";
                     var state = '';
                     if (list[i].state == 1)
                         state = "<span style='color: green;'>成功</span>";
                     else if (list[i].state == 0) {
                         if (list[i].callback_date == null)
                             state = "<span style='color:#ccc;'>取消</span>";
                         else
                             state = "<span style='color:red'>失败</span>";
                     }
                     html += "<tr>";
                     html += "<td>" + list[i].user_id + "</td>";
                     html += "<td><a href='detail.html?id=" + list[i].id + "'>" + list[i].orderid + "</a></td>";
                     html += "<td>" + list[i].total_price + "元</td>";
                     html += "<td>" + list[i].pay_price + "元</td>";
                     html += "<td>" + platform + "</td>";
                     html += "<td>" + state + "</td>";
                     html += "<td>" + DateFormat(list[i].date) + "</td>";
                     html += "<td><a href='detail.html?id=" + list[i].id + "'>查看</a></td>";
                     html += "</tr>";
                 }

                 $("#list").html(html);
                 var pager = new Pager();
                 $(".page_info").css("display", "block")
                 pager.initPage(page, data.item.itemCount, 20, 5, GetList);
             }
         });
     }

     function DateFormat(date) {
         return date.toString().replace("T", " ").substring(0, 19)
     }
     function submits() {
         GetList(1);
     }
 </script>
</body>
</html>
